namespace Digitalmes.Domain.Sys;

/// <summary>
/// 字典分类信息
/// </summary>
[SugarTable("sys_codetype", "字典分类信息")]
public class SysCodetype : EntityTenantBase, IDeletedFilter
{
    /// <summary>
    /// 父节点
    /// </summary>
    [SugarColumn(ColumnDescription = "父节点")]
    public long ParentId { get; set; }

    /// <summary>
    /// 父级集合，没有返回空
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "父级", IsJson = true, Length = 512)]
    public List<long>? ParentIdList { get; set; }

    /// <summary>
    /// 层级
    /// </summary>
    [SugarColumn(ColumnDescription = "层级")]
    public int Layer { get; set; } = 1;

    /// <summary>
    /// 分类名称
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "分类名称", Length = 32)]
    public string? Name { get; set; }

    /// <summary>
    /// 分类标识
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "分类标识", Length = 64)]
    public string? Code { get; set; }

    /// <summary>
    /// 1=系统 2=应用
    /// </summary>
    [SugarColumn(ColumnDescription = "分类，1=>系统,2=>应用")]
    public int Types { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    [SugarColumn(ColumnDescription = "排序")]
    public int Sort { get; set; } = 1;

    /// <summary>
    /// 是否系统内置集成
    /// </summary>
    [SugarColumn(ColumnDescription = "是否系统内置集成")]
    public bool IsSystem { get; set; }

    /// <summary>
    /// 是否删除
    /// </summary>
    [SugarColumn(ColumnDescription = "是否删除")]
    public bool IsDel { get; set; }

    /// <summary>
    /// 字典项集合
    /// </summary>
    [Navigate(NavigateType.OneToMany, nameof(SysCode.TypeId))]
    public List<SysCode>? Codes { get; set; }
}
